#include <bits/stdc++.h>
using namespace std;

#define ONLINE_JUDGE

#ifndef ONLINE_JUDGE
#define dbg(x...)                             \
	{                                         \
		cerr << "\033[32;1m" << #x << " -> "; \
		err(x);                               \
	}
void err()
{
	cerr << "\033[39;0m" << endl;
}
template <typename T, typename... A>
void err(T a, A... x)
{
	cerr << a << ' ';
	err(x...);
}
#else
#define dbg(...)
#endif

typedef long long LL;
const int N = 105, M = N * N;

typedef pair<int, int> P;

int n, m;

char mp[N][N][2];
unordered_set<int> S[M];
int fa[M];

const char *YES = "Come this way",
		   *NO = "They shall not pass";

const int dy[6] = {-1, -1, 0, 0, 1, 1},
		  dx[6] = {-1, 0, -1, 1, 0, 1};

vector<P> G[M];

int id[N][N];

inline bool inbound(int l, int r, int x)
{
	return l <= x && x <= r;
}

inline bool valid(int x, int y)
{
	return inbound(0, n - 1, x) && inbound(0, m - 1, y) && mp[x][y][0] != 'm';
}

struct PqNode
{
	P dis;
	int v;

	PqNode(P dis = P(0, 0), int v = 0) : dis(dis), v(v)
	{
	}

	bool operator>(const PqNode &other) const
	{
		return dis > other.dis;
	}
};

P dis[M];

int main(int argc, char const *argv[])
{
	scanf("%d%d", &n, &m);

	for (int j = 0; j < m; ++j)
		for (int i = 0; i < n; ++i)
			scanf("%s", mp[i][j]);
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < m; ++j)
			id[i][j] = i * m + j;
	int r;
	scanf("%d", &r);
	for (int i = 0; i < r; ++i)
	{
		P x, y;
		scanf("%d%d%d%d", &x.first, &x.second, &y.first, &y.second);
		int u = id[x.first][x.second], v = id[y.first][y.second];

		S[u].insert(v);
		S[v].insert(u);
	}

	for (int i = 0; i < n; ++i)
		for (int j = 0; j < m; ++j)
		{
			for (int r = 0; r < 6; ++r)
			{
				int tx = i + dx[r], ty = j + dy[r];
				if (valid(tx, ty))
				{
					int u = id[i][j], v = id[tx][ty];
					int w = 1;
					dbg(u, v, w);
					// from plain to hill
					if (mp[i][j][0] == 'p' && mp[tx][ty][0] == 'h')
						++w;

					// to forest and marsh
					if (mp[tx][ty][1] != 'g')
						++w;

					// river
					if (S[u].count(v))
						w = 1e6;

					G[u].emplace_back(v, w);
				}
			}
		}

	priority_queue<PqNode, vector<PqNode>, greater<PqNode>> pq;

	int M;
	scanf("%d", &M);
	P S, T;
	scanf("%d%d%d%d", &S.first, &S.second, &T.first, &T.second);
	int ss = id[S.first][S.second], tt = id[T.first][T.second];

	int tot = n * m;
	for (int i = 0; i < tot; ++i)
		dis[i] = P(100000, 100000);

	dis[ss] = P(0, 0);
	pq.emplace(P(0, 0), ss);
	while (!pq.empty())
	{
		auto now = pq.top();
		dbg(now.v);
		pq.pop();
		if (dis[now.v] < now.dis)
			continue;
		for (const auto &e : G[now.v])
		{
			int u = now.v, v = e.first;
			P nextDis = now.dis;
			nextDis.second += e.second;
			if (nextDis.second >= M)
			{
				++nextDis.first;
				nextDis.second = 0;
			}

			dbg(u, v);

			if (nextDis < dis[v])
			{
				dis[v] = nextDis;
				pq.emplace(dis[v], v);
				fa[v] = u;
			}
		}
	}
	if (dis[tt].first >= 100000)
		printf("%s\n", NO);
	else
	{
		vector<int> seq;
		for (int now = tt; now != ss; now = fa[now])
			seq.push_back(now);
		seq.push_back(ss);
		reverse(seq.begin(), seq.end());
		if (dis[tt].second > 0)
		{
			++dis[tt].first;
			dis[tt].second = 0;
		}
		printf("%s\n%d\n%d\n", YES, dis[tt].first, (int)seq.size());
		for (int x : seq)
		{
			int xx = x / m, yy = x % m;
			printf("%d %d\n", xx, yy);
		}
	}

	dbg(dis[id[2][1]].first, dis[id[2][1]].second, dis[id[1][1]].first, dis[id[1][1]].second);

	return 0;
}